package com.anolesoft.twelvePlan.mapper;

import com.anolesoft.twelvePlan.dto.MesPlanXiadaFuzerenDTO;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author zyq
 * @date 2022/7/12
 */
@Mapper
public interface MesPlanXiadaFuzerenMapper {
    @Select("select b.objuid, a.mes_plan_xiada_uid, a.stf_employee_uid, a.create_time, a.createuid, b.name " +
            "from (select * from mes_plan_xiada_fuzeren a where a.mes_plan_xiada_uid = #{xiadaObj}) a \n" +
            "inner join (select b.objuid,b.name from stf_employee b) b\n" +
            "on a.stf_employee_uid = b.objuid")
    List<MesPlanXiadaFuzerenDTO> queryFuzeren(String xiadaObj);

    @Delete("delete from mes_plan_xiada_fuzeren a where a.mes_plan_xiada_uid = #{xiadaObj}")
    void deleteFuzeren(String xiadaObj);

    @Insert("insert into mes_plan_xiada_fuzeren(mes_plan_xiada_uid, stf_employee_uid)" +
            "values (#{mesPlanXiadaUid}, #{stfEmployeeUid})")
    void insertFuzeren(@Param("mesPlanXiadaUid") String mesPlanXiadaUid, @Param("stfEmployeeUid") String stfEmployeeUid);
}
